package itsm.isperp.module.controller.incident; 

import java.util.List;
import java.util.Map;

import itsm.isperp.framework.web.controller.BaseController;
import itsm.isperp.module.entity.app.AppUser;
import itsm.isperp.module.entity.incident.IcdCategoryRelamembers;
import itsm.isperp.module.service.incident.IcdCategoryRelamembersService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 控制器
 * 
 * @author lizx
 * @date 2015-04-05 12:21
 */
@Controller
@RequestMapping("incident/categoryRelamembers")
public class IcdCategoryRelamembersController extends BaseController<IcdCategoryRelamembers> {

	@Autowired
	protected IcdCategoryRelamembersService icdCategoryRelamembersService;

	@Override
	public IcdCategoryRelamembersService getService() {
		return this.icdCategoryRelamembersService;
	}
	
	@Override
	public String getPageTitle() {
		return "事件了类别关联工程师";
	}
	
	
	@RequestMapping("findAllMemberByProjectId")
	@ResponseBody
	public List<Map<String, Object>> findAllMemberByProjectId(String categoryId) {

		categoryId=categoryId.replace(",",new String());
		List<Map<String, Object>> resultList=this.icdCategoryRelamembersService.findAllMemberByCategoryId(categoryId);
		return resultList;

	}
	
	@RequestMapping("findRelaAppUserByCategoryIdAndRole")
	@ResponseBody
	public List<AppUser> findRelaAppUserByCategoryIdAndRole(String categoryId)
	{
		return this.icdCategoryRelamembersService.findRelaAppUserByCategoryIdAndRole(categoryId,"二线支持人员(信息系统部)");
		
	}
 
	
	
}
